#pragma once

#include "../SGD Wrappers/CSGD_TextureManager.h"


#include "AnimationInfo.h"

class CAnimation;
//class CFrame;
#include "Frame.h"
#include <map>
#include <string>
using namespace std;

#include "../tinyxml/tinyxml.h"

class CAnimationManager
{
	std::map< string, CAnimation* > m_mLoadedAnimations;	
	CSGD_TextureManager*	m_pTM;	

	// reference count
	//unsigned int	m_unRefCount;

	CAnimationManager(void);
	~CAnimationManager(void);	
	CAnimationManager& operator=( const CAnimationManager& );
	CAnimationManager( const CAnimationManager& );

public:

	static CAnimationManager* GetInstance();
	bool Load( const char* _szFilename );

	void Update( CAnimationInfo* _cCurrAnimation, float _fElapsedTime );
	void Render( CAnimationInfo* _cCurrAnimation, int _nPosX, int _nPosY, 
			bool bIsFlipped, DWORD dwColor );
	void Shutdown(void);

	
	//void AddRef( void );
	//void Release( void );

	// TEMPORARY CODE**********************
	CAnimation* Animation;
	CAnimation* m_pXMLanimation;
	CFrame* tempFrame;
	CFrame	m_pFrame;

	friend CAnimationInfo;

};

